<template>
  <!-- html -->
  <div class="person">
    <h2>中国</h2>
    <h2 ref="shandong">山东</h2>
    <h2>找蓝翔</h2>
    <button @click="showLog">打印h2元素</button>
  </div>
</template>

<script lang="ts" setup name="Person">
import { ref, defineExpose } from "vue";

//创建一个shandong，用于存储ref标记的内容
let shandong = ref();
let a = ref(1);
let b = ref(1);
let c = ref(1);
function showLog() {
  console.log(console.log(shandong.value));
}
defineExpose({ a, b, c });
</script>
<style scoped>
/* scoped表示样式只能影响到当前.vue的template */
.person {
  background-color: skyblue;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 20px;
}
button {
  margin: 0 5px;
}
</style>
